#ifndef MYTASK_H
#define MYTASK_H
 
#include <QObject>
 
class MyTask : public QObject {
Q_OBJECT
public:
    explicit MyTask(QObject *parent = nullptr);
 
public:
    void start(); //触发started信号(可选)
 
public Q_SLOTS:
        void doWork(); ///执行线程任务
 
Q_SIGNALS:
        void started(); //用于和槽函数doWork关联，然后在主线程中触发该信号，doWork函数会在新线程中执行
 
};
 
#endif // MYTASK_H
